<?php
declare (strict_types=1);

//引入Builder相关路由
require_once root_path('/addons/BuilderPlus/contract/event') . 'route.php';

use think\facade\Route;

Route::miss(function () {
    return \think\facade\View::fetch(app()->getBasePath() . '/error/empty.html', [
        'msg' => '没有匹配到正确路由：' . request()->url(),
    ]);
});

//登录
Route::group('login', function () {
    Route::get('/index', 'login/index');
    Route::post('/login', 'login/login');
    Route::post('/logout', 'login/logout');
});

//上传
Route::group('uploads', function () {
    Route::post('/image', 'uploads/image');
    Route::post('/video', 'uploads/video');
    Route::post('/editor', 'uploads/editor');
    Route::post('/file', 'uploads/file');
});

//首页
Route::get('/', 'index/index')->middleware('verify');
Route::group('index', function () {
    Route::get('/index', 'index/index');
    Route::get('/welcome', 'index/welcome');
    Route::post('/clearCache', 'index/clearCache');
    Route::get('/getRemind', 'index/getRemind');
    Route::get('/getArea', 'index/getArea');
})->middleware('verify');

//我的桌面
Route::group('desktop', function () {
    Route::get('/index', 'desktop/index');
})->middleware('verify');

//会员管理
Route::group('user', function () {
    Route::get('/index', 'user/index');
    Route::get('/choose', 'user/choose');
    Route::get('/getList', 'user/getList');
    Route::get('/add', 'user/add');
    Route::get('/edit', 'user/edit');
    Route::post('/save', 'user/save');
    Route::post('/update', 'user/update');
    Route::post('/delete', 'user/delete');
    Route::post('/reset', 'user/reset');
    Route::post('/login', 'user/login');
    Route::post('/active', 'user/active');
    Route::get('/checkBalance', 'user/checkBalance');
    Route::rule('/recharge', 'user/recharge', 'get|post');
})->middleware('verify');

//推荐关系
Route::group('relation', function () {
    Route::get('/index', 'relation/index');
    Route::get('/getData', 'relation/getData');
})->middleware('verify');

//公排关系
Route::group('node', function () {
    Route::get('/index1', 'node/index1');
    Route::get('/index2', 'node/index2');
    Route::get('/index3', 'node/index3');
})->middleware('verify');

//实名认证
Route::group('userAuth', function () {
    Route::get('/index', 'userAuth/index');
    Route::get('/getList', 'userAuth/getList');
    Route::get('/edit', 'userAuth/edit');
    Route::post('/save', 'userAuth/save');
})->middleware('verify');

//账户管理
Route::group('account', function () {
    Route::get('/index', 'account/index');
    Route::get('/recharge', 'account/recharge');
    Route::get('/bonus', 'account/bonus');
    Route::get('/getList', 'account/getList');
})->middleware('verify');

//充值管理
Route::group('remit', function () {
    Route::get('/index', 'remit/index');
    Route::get('/getList', 'remit/getList');
    Route::get('/edit', 'remit/edit');
    Route::post('/save', 'remit/save');
    Route::post('/batchPass', 'remit/batchPass');
    Route::post('/batchReject', 'remit/batchReject');
})->middleware('verify');

//提现管理
Route::group('draw', function () {
    Route::get('/index', 'draw/index');
    Route::get('/getList', 'draw/getList');
    Route::get('/edit', 'draw/edit');
    Route::post('/save', 'draw/save');
    Route::post('/batchPass', 'draw/batchPass');
    Route::post('/batchReject', 'draw/batchReject');
})->middleware('verify');

//转账管理
Route::group('transfer', function () {
    Route::get('/index', 'transfer/index');
    Route::get('/getList', 'transfer/getList');
})->middleware('verify');

//转换管理
Route::group('exchange', function () {
    Route::get('/index', 'exchange/index');
    Route::get('/getList', 'exchange/getList');
})->middleware('verify');

//奖金总表-按日期统计
Route::group('summaryDate', function () {
    Route::get('/index', 'summaryDate/index');
    Route::get('/getList', 'summaryDate/getList');
    Route::get('/summaryInfo', 'summaryDate/summaryInfo');
})->middleware('verify');

//奖金总表-按会员统计
Route::group('summaryUser', function () {
    Route::get('/index', 'summaryUser/index');
    Route::get('/getList', 'summaryUser/getList');
    Route::get('/summaryInfo', 'summaryUser/summaryInfo');
})->middleware('verify');

//交易列表-线上
Route::group('tradeOnline', function () {
    Route::get('/index', 'tradeOnline/index');
    Route::get('/getList', 'tradeOnline/getList');
    Route::get('/orderInfo', 'tradeOnline/orderInfo');
})->middleware('verify');

//交易订单-线上
Route::group('tradeOnlineOrder', function () {
    Route::get('/index', 'tradeOnlineOrder/index');
    Route::get('/getList', 'tradeOnlineOrder/getList');
})->middleware('verify');

//交易列表-线下
Route::group('tradeOffline', function () {
    Route::get('/index', 'tradeOffline/index');
    Route::get('/getList', 'tradeOffline/getList');
    Route::get('/orderInfo', 'tradeOffline/orderInfo');
})->middleware('verify');

//交易订单-线下
Route::group('tradeOfflineOrder', function () {
    Route::get('/index', 'tradeOfflineOrder/index');
    Route::get('/getList', 'tradeOfflineOrder/getList');
    Route::get('/edit', 'tradeOfflineOrder/edit');
    Route::post('/save', 'tradeOfflineOrder/save');
})->middleware('verify');

//新闻公告
Route::group('news', function () {
    Route::get('/index', 'news/index');
    Route::get('/getList', 'news/getList');
    Route::get('/add', 'news/add');
    Route::get('/edit', 'news/edit');
    Route::post('/save', 'news/save');
    Route::post('/update', 'news/update');
    Route::post('/delete', 'news/delete');
})->middleware('verify');

//轮播管理
Route::group('carousel', function () {
    Route::get('/index', 'carousel/index');
    Route::get('/getList', 'carousel/getList');
    Route::get('/add', 'carousel/add');
    Route::get('/edit', 'carousel/edit');
    Route::post('/save', 'carousel/save');
    Route::post('/update', 'carousel/update');
    Route::post('/delete', 'carousel/delete');
})->middleware('verify');

//留言管理
Route::group('message', function () {
    Route::get('/index', 'message/index');
    Route::get('/getList', 'message/getList');
    Route::get('/edit', 'message/edit');
    Route::post('/save', 'message/save');
})->middleware('verify');

//消息通知
Route::group('userNotify', function () {
    Route::get('/index', 'userNotify/index');
    Route::get('/getList', 'userNotify/getList');
    Route::get('/add', 'userNotify/add');
    Route::post('/save', 'userNotify/save');
    Route::post('/delete', 'userNotify/delete');
})->middleware('verify');

//配置管理
Route::group('config', function () {
    Route::get('/index', 'config/index');
    Route::get('/getList', 'config/getList');
    Route::get('/add', 'config/add');
    Route::get('/edit', 'config/edit');
    Route::post('/save', 'config/save');
    Route::post('/update', 'config/update');
    Route::post('/delete', 'config/delete');
    Route::get('/create', 'config/create');
    Route::post('/saveGroup', 'config/saveGroup');
})->middleware('verify');

//菜单管理
Route::group('menu', function () {
    Route::get('/index', 'menu/index');
    Route::get('/getList', 'menu/getList');
    Route::get('/add', 'menu/add');
    Route::get('/edit', 'menu/edit');
    Route::post('/save', 'menu/save');
    Route::post('/update', 'menu/update');
    Route::post('/delete', 'menu/delete');
})->middleware('verify');

//主题风格
Route::group('theme', function () {
    Route::get('/index', 'theme/index');
    Route::get('/color', 'theme/color');
    Route::post('/change', 'theme/change');
})->middleware('verify');

//个人中心
Route::group('userMenu', function () {
    Route::get('/index', 'userMenu/index');
    Route::get('/getList', 'userMenu/getList');
    Route::get('/edit', 'userMenu/edit');
    Route::post('/save', 'userMenu/save');
    Route::rule('/update', 'userMenu/update');
})->middleware('verify');

//热门搜索
Route::group('hotSearch', function () {
    Route::get('/index', 'hotSearch/index');
    Route::get('/getList', 'hotSearch/getList');
    Route::get('/add', 'hotSearch/add');
    Route::get('/edit', 'hotSearch/edit');
    Route::post('/save', 'hotSearch/save');
    Route::post('/update', 'hotSearch/update');
    Route::post('/delete', 'hotSearch/delete');
})->middleware('verify');

//银行管理
Route::group('bank', function () {
    Route::get('/index', 'bank/index');
    Route::get('/getList', 'bank/getList');
    Route::get('/add', 'bank/add');
    Route::get('/edit', 'bank/edit');
    Route::post('/save', 'bank/save');
    Route::post('/update', 'bank/update');
    Route::post('/delete', 'bank/delete');
})->middleware('verify');

//物流管理
Route::group('express', function () {
    Route::get('/index', 'express/index');
    Route::get('/getList', 'express/getList');
    Route::get('/add', 'express/add');
    Route::get('/edit', 'express/edit');
    Route::post('/save', 'express/save');
    Route::post('/update', 'express/update');
    Route::post('/delete', 'express/delete');
    Route::get('/list', 'express/list');
})->middleware('verify');

//管理员角色
Route::group('role', function () {
    Route::get('/index', 'role/index');
    Route::get('/getList', 'role/getList');
    Route::get('/add', 'role/add');
    Route::get('/edit', 'role/edit');
    Route::post('/save', 'role/save');
    Route::post('/update', 'role/update');
    Route::post('/delete', 'role/delete');
    Route::rule('/give', 'role/give', 'get|post');
})->middleware('verify');

//管理员管理
Route::group('admin', function () {
    Route::get('/index', 'admin/index');
    Route::get('/getList', 'admin/getList');
    Route::get('/add', 'admin/add');
    Route::get('/edit', 'admin/edit');
    Route::post('/save', 'admin/save');
    Route::post('/update', 'admin/update');
    Route::post('/delete', 'admin/delete');
    Route::post('/reset', 'admin/reset');
    Route::rule('/password', 'admin/password', 'get|post');
})->middleware('verify');

//数据管理
Route::group('backup', function () {
    Route::get('/index', 'backup/index');
    Route::get('/add', 'backup/add');
    Route::get('/import', 'backup/import');
    Route::get('/clear', 'backup/clear');
    Route::get('/delete', 'backup/delete');
})->middleware('verify');

//操作日志
Route::group('logs', function () {
    Route::get('/index', 'logs/index');
    Route::get('/getList', 'logs/getList');
})->middleware('verify');

//插件管理
Route::group('addons', function () {
    Route::get('/index', '\addons\Plugin@index');
    Route::get('/getList', '\addons\Plugin@getList');
    Route::post('/install', '\addons\Plugin@install');
    Route::post('/uninstall', '\addons\Plugin@uninstall');
    Route::post('/locking', '\addons\Plugin@locking');
    Route::post('/update', '\addons\Plugin@update');
})->middleware('verify');

//会员等级
Route::group('level', function () {
    Route::get('/index', 'level/index');
    Route::get('/getList', 'level/getList');
    Route::get('/edit', 'level/edit');
    Route::post('/save', 'level/save');
})->middleware('verify');

//会员等级
Route::group('userPlatoon', function () {
    Route::get('/index', 'userPlatoon/index');
    Route::get('/getList', 'userPlatoon/getList');
    Route::get('/edit', 'userPlatoon/edit');
    Route::post('/save', 'userPlatoon/save');
})->middleware('verify');
